package com.yanqu.road.server.manger.activity.hsisland.pb;

import com.yanqu.road.entity.activity.hsisland.config.*;
import com.yanqu.road.pb.activity.HsIslandProto;
import com.yanqu.road.server.manger.ServerLanguageMgr;

public class HsIslandActivityPb {

    /**
     * 船配置
     * @param hsIslandBoatConfig
     * @return
     */
    public static HsIslandProto.HsIslandBoatConfig.Builder buildHsIslandBoatConfig(HsIslandBoatConfig hsIslandBoatConfig, String language) {
        HsIslandProto.HsIslandBoatConfig.Builder builder = HsIslandProto.HsIslandBoatConfig.newBuilder();
        builder.setId(hsIslandBoatConfig.getId());
        builder.setAppearance(hsIslandBoatConfig.getAppearance());
        builder.setExp(hsIslandBoatConfig.getExp());
        builder.setPowerIncrease(hsIslandBoatConfig.getPowerIncrease());
        builder.setName(ServerLanguageMgr.getContent(hsIslandBoatConfig.getName(), language));
        return builder;
    }

    /**
     * 岛屿配置
     * @param config
     * @return
     */
    public static HsIslandProto.HsIslandIslandConfig.Builder buildHsIslandIslandConfig(HsIslandIslandConfig config) {
        HsIslandProto.HsIslandIslandConfig.Builder builder = HsIslandProto.HsIslandIslandConfig.newBuilder();
        builder.setId(config.getId());
        builder.setLatticeParam(config.getLatticeParam());
        builder.setMapType(config.getMapType());
        builder.setMapParam(config.getMapParam());
        builder.setPngParam(config.getPngParam());
        builder.setWeight(config.getWeight());
        return builder;
    }

    /**
     * 事件配置
     * @param config
     * @return
     */
    public static HsIslandProto.HsIslandEventConfig.Builder buildHsIslandEventConfig(HsIslandEventConfig config, String language) {
        HsIslandProto.HsIslandEventConfig.Builder builder = HsIslandProto.HsIslandEventConfig.newBuilder();
        builder.setId(config.getId());
        builder.setLatticeParam(config.getLatticeParam());
        builder.setCanTransit(config.getCanTransit());
        builder.setIsHighlight(config.getIsHighlight());
        builder.setIsNotice(config.getIsNotice());
        builder.setPersonNoticeText(ServerLanguageMgr.getContent(config.getPersonNoticeText(), language));
        builder.setGuildNoticeText(ServerLanguageMgr.getContent(config.getGuildNoticeText(), language));
        builder.setCanWorkBuff(config.getCanWorkBuff());
        builder.setEventDesc(ServerLanguageMgr.getContent(config.getEventDesc(), language));
        builder.setEventExplain(ServerLanguageMgr.getContent(config.getEventExplain(), language));
        return builder;
    }

    /**
     * pve配置
     * @param config
     * @return
     */
    public static HsIslandProto.HsIslandPveConfig.Builder buildHsIslandPveConfig(HsIslandPveConfig config, String language) {
        HsIslandProto.HsIslandPveConfig.Builder builder = HsIslandProto.HsIslandPveConfig.newBuilder();
        builder.setId(config.getId());
        builder.setType(config.getType());
        builder.setAppearanceId(config.getAppearanceId());
        builder.setName(ServerLanguageMgr.getContent(config.getName(), language));
        builder.setDesc(ServerLanguageMgr.getContent(config.getDesc(), language));
        builder.setTitle(ServerLanguageMgr.getContent(config.getTitle(), language));
        builder.setTalkText(ServerLanguageMgr.getContent(config.getTalkText(), language));
        builder.setHp(config.getHp());
        builder.setQuality(config.getQuality());
        builder.setReward(config.getReward());
        builder.setScore(config.getScore());
        builder.setCanInviteNum(config.getCanInviteNum());
        builder.setWeight(config.getWeight());
        builder.setTab(config.getTab());
        return builder;
    }

    /**
     * 决斗配置
     * @param config
     * @return
     */
    public static HsIslandProto.HsIslandDuelConfig.Builder buildHsIslandDuelConfig(HsIslandDuelConfig config) {
        HsIslandProto.HsIslandDuelConfig.Builder builder = HsIslandProto.HsIslandDuelConfig.newBuilder();
        builder.setId(config.getId());
        builder.setVictoryNum(config.getVictoryNum());
        builder.setReward(config.getReward());
        return builder;
    }

    /**
     * 宝箱配置
     * @param config
     * @return
     */
    public static HsIslandProto.HsIslandBoxConfig.Builder buildHsIslandBoxConfig(HsIslandBoxConfig config) {
        HsIslandProto.HsIslandBoxConfig.Builder builder = HsIslandProto.HsIslandBoxConfig.newBuilder();
        builder.setId(config.getId());
        builder.setReward(config.getReward());
        builder.setNum(config.getNum());
        return builder;
    }

    /**
     * 2选择1配置
     * @param config
     * @return
     */
    public static HsIslandProto.HsIslandChooseConfig.Builder buildHsIslandChooseConfig(HsIslandChooseConfig config, String language) {
        HsIslandProto.HsIslandChooseConfig.Builder builder = HsIslandProto.HsIslandChooseConfig.newBuilder();
        builder.setId(config.getId());
        builder.setTitle(ServerLanguageMgr.getContent(config.getTitle(), language));
        builder.setDesc(ServerLanguageMgr.getContent(config.getDesc(), language));
        builder.setChooseTitle(ServerLanguageMgr.getContent(config.getChooseTitle(), language));
        builder.setIcon(config.getIcon());
        builder.setChooseText(ServerLanguageMgr.getContent(config.getChooseText(), language));
        builder.setTrueReward(config.getTrueReward());
        builder.setErrorReward(config.getErrorReward());
        builder.setType(config.getType());
        return builder;
    }

    /**
     * buff配置
     * @param config
     * @return
     */
    public static HsIslandProto.HsIslandBuffConfig.Builder buildHsIslandBuffConfig(HsIslandBuffConfig config, String language) {
        HsIslandProto.HsIslandBuffConfig.Builder builder = HsIslandProto.HsIslandBuffConfig.newBuilder();
        builder.setId(config.getId());
        builder.setType(config.getType());
        builder.setName(ServerLanguageMgr.getContent(config.getName(), language));
        builder.setDesc(ServerLanguageMgr.getContent(config.getDesc(), language));
        builder.setParam(config.getParam());
        builder.setTimes(config.getTimes());
        builder.setWeight(config.getWeight());
        return builder;
    }

    /**
     * 奇遇配置
     * @param config
     * @return
     */
    public static HsIslandProto.HsIslandRelicConfig.Builder buildHsIslandRelicConfig(HsIslandRelicConfig config) {
        HsIslandProto.HsIslandRelicConfig.Builder builder = HsIslandProto.HsIslandRelicConfig.newBuilder();
        builder.setId(config.getId());
        builder.setReward(config.getReward());
        builder.setWeight(config.getWeight());
        return builder;
    }

    /**
     * boss奖励配置
     * @param config
     * @return
     */
    public static HsIslandProto.HsIslandBossRewardConfig.Builder buildHsIslandBossRewardConfig(HsIslandBossRewardConfig config) {
        HsIslandProto.HsIslandBossRewardConfig.Builder builder = HsIslandProto.HsIslandBossRewardConfig.newBuilder();
        builder.setId(config.getId());
        builder.setRank(config.getRank());
        builder.setReward(config.getReward());
        return builder;
    }

    /**
     * 圣柱馈赠配置
     * @param config
     * @return
     */
    public static HsIslandProto.HsIslandGiftConfig.Builder buildHsIslandGiftConfig(HsIslandGiftConfig config, String language) {
        HsIslandProto.HsIslandGiftConfig.Builder builder = HsIslandProto.HsIslandGiftConfig.newBuilder();
        builder.setId(config.getId());
        builder.setName(ServerLanguageMgr.getContent(config.getName(), language));
        builder.setAppearanceId(config.getAppearanceId());
        builder.setReward(config.getReward());
        builder.setWeight(config.getWeight());
        builder.setScore(config.getScore());
        return builder;
    }
}
